#ifndef __KEY_H
#define __KEY_H

/*********************************************************************
 * INCLUDES
 */
#include "stdio.h"
#include <at32f4xx.h>

/* Private define ------------------------------------------------------------*/
/*define button*/
typedef enum
{
    IOIN_PB0 = 0,
    IOIN_PB1,
		IOIN_PB12,
} IOIN_Type;

#define IOIN_NUM  3

#define IOIN_PB0_PIN              GPIO_Pins_0            
#define IOIN_PB0_GPIO             GPIOB
#define IOIN_PB0_RCC_CLK          RCC_APB2PERIPH_GPIOB
#define IOIN_PB1_PIN              GPIO_Pins_1            
#define IOIN_PB1_GPIO             GPIOB
#define IOIN_PB1_RCC_CLK          RCC_APB2PERIPH_GPIOB
#define IOIN_PB12_PIN             GPIO_Pins_12            
#define IOIN_PB12_GPIO            GPIOB
#define IOIN_PB12_RCC_CLK         RCC_APB2PERIPH_GPIOB


/* Extern variables ---------------------------------------------------------*/
extern GPIO_Type *IOIN_GPIO_PORT[IOIN_NUM];
extern uint16_t IOIN_GPIO_PIN[IOIN_NUM];
extern uint32_t IOIN_GPIO_RCC_CLK [IOIN_NUM];

extern uint16_t IOIN_EXTI_LINE[IOIN_NUM];
extern uint16_t IOIN_EXTI_IRQ[IOIN_NUM];
extern uint8_t IOIN_EXTI_SOURCE_PORT[IOIN_NUM];
extern uint8_t IOIN_EXTI_SOURCE_PIN[IOIN_NUM];

/* Private functions ---------------------------------------------------------*/
/*Button Operation function*/
void IOIN_Init(IOIN_Type button);
uint8_t IOIN_State(IOIN_Type button);
void IOIN_EXTI_Init(IOIN_Type button);

#endif /* __KEY_H */





























